<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHonoursTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('honours', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamp('time', 6);
            $table->integer('visits');
            $table->string('name', 20)->unique();
            $table->string('cover_img', 80)->default('./products/default.jpg');
            $table->integer('u_id')->unsigned()->index();
            $table->foreign('u_id')->references('id')->on('users');

            $table->string('EN_name', 20)->unique()->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('honours');
    }
}
